#include <iostream>
#include <uv.h>

void periodic_job(uv_timer_t* handle) {
    std::cout << "periodic timer !!!" << std::endl;;
}

void once_job(uv_timer_t* handle) {
    std::cout << "once timer !!!" << std::endl;;
}

int main() {
    uv_loop_t* loop = uv_default_loop();

    uv_timer_t time_req;
    uv_timer_init(loop, &time_req);
    uv_timer_start(&time_req, periodic_job, 0, 5000);

    uv_timer_t once_req;
    uv_timer_init(loop, &once_req);
    uv_timer_start(&once_req, once_job, 3000, 0);

    return uv_run(loop, UV_RUN_DEFAULT);
}
